Let \(X\) be a Hausdorff space and let \(A \subset X\) be a retract of \(X\). We will show that \(X \, \backslash \, A\) is open. Since \(A\) is a retract of \(X\) there exists a continuous map \(f: X \rightarrow A\) such that \(f(x)=x\) for all \(x \in A\). Notice that \(f(a) \in A\) but \(f(a) \neq a\) since \(a \notin A\).
Since \(X\) is Hausdorff there exists disjoint open sets \(U\) and \(V\) such that \(a \in U\) \(f(a) \in V\). It follows that \(W = U \cap f^{-1}(V)\) is an open set containing \(a\).
Now, it suffices to show that \(W\) and \(A\) are disjoint. Let \(y \in W \cap A\). It follows that \(f(y) \neq y\) since \(f(y) \in V\), and for disjoint sets \(U\) and \(V\), \(y \in U\). Hence, \(y \notin A\) and \(W\) is an open neighborhood of \(a\) lying completely in \(X \, \backslash \, A\).
Since \(a\) was chosen arbitrarily, every point in \(X \, \backslash \, A\) has an open neighborhood lying completely in \(X \, \backslash \, A\). Thus, \(X \, \backslash \, A\) is open and \(A\) is closen.
Q.E.D.
Let \(X\) and \(Y\) be Hausforff topological spaces and define the product topology \(X \times Y\). By the definition of product topology, a point in \(X \times Y\) is of the form \((x,y)\) where \(x \in X\) and \(y \in Y\). This means that we can pick two distinct points \((a,b)\) and \((c,d)\) in \(X \times Y\) where \(a \neq c\) or \(b \neq d\) (or both).
Since \(X\) is Hausdorff there exists open disjoint sets \(U_1,\; U_2\) such that \(a \in U_1\) and \(c \in U_2\). Likewise, since \(Y\) is Hausdorff there exists open disjoint sets \(V_1,\;V_2\) such that \(b \in V_1\) and \(d \in V_2\).
Without loss of generality\(_1\), assume \(b \neq d\). Then \(V_1, \: V_2\) are two open disjoint sets such that \(b \in V_1\) and \(d \in V_2\). It follows that \(X \times V_1\) and \(X \times V_2\) are open disjoint sets in \(X \times Y\) such that \((a,b) \in X \times V_1\) and \((c,d) \in X \times V_2\). Thus, \(X \times Y\) is Hausdorff.
Q.E.D.